/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 浅色模式变量 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    --text-primary: #333;
    --text-secondary: #666;
    --bg-primary: #f4f4f4;
    --bg-secondary: #fff;
    --bg-header: #fff;
    --bg-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-about: #fff;
    --bg-portfolio: #f8f9fa;
    --bg-contact: #fff;
    --bg-footer: #2c3e50;
    --bg-card: white;
    --bg-language-selector: #f4f4f4;
    --color-primary: #3498db;
    --color-secondary: #2980b9;
    --color-accent: #e74c3c;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-error: #e74c3c;
    --border-color: #ddd;
    --box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 深色模式变量 */
body.dark-theme {
    --text-primary: #f5f5f5;
    --text-secondary: #bbb;
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-header: #1e1e1e;
    --bg-hero: linear-gradient(135deg, #2d3e50 0%, #34495e 100%);
    --bg-about: #1e1e1e;
    --bg-portfolio: #1a1a1a;
    --bg-contact: #1e1e1e;
    --bg-footer: #1a1a1a;
    --bg-card: #2d2d2d;
    --bg-language-selector: #2d2d2d;
    --color-primary: #4a9eff;
    --color-secondary: #357abd;
    --color-accent: #ff5c5c;
    --color-success: #41b883;
    --color-warning: #ffc107;
    --color-error: #ff5c5c;
    --border-color: #333;
    --box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* 应用主题变量到元素 */
body {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: var(--bg-header);
    box-shadow: var(--box-shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-language-selector);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
    margin-left: 10px;
}

.theme-toggle:hover {
    background: var(--color-primary);
    transform: scale(1.1);
}

/* Language Selector Styles */
.language-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-language-selector);
    border-radius: 20px;
    padding: 2px;
}

.language-selector button {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.language-selector button:hover {
    color: #3498db;
}

.language-selector button.active {
    background: #3498db;
    color: white;
}

/* Hero Section */
.hero {
    background: var(--bg-hero);
    color: white;
    text-align: center;
    padding: 150px 20px 100px;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    animation: float 8s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.particle-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    height: 1px;
    pointer-events: none;
    transform-origin: left center;
    transition: opacity 0.3s ease;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    25% {
        transform: translateY(-30px) rotate(90deg) scale(1.1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) rotate(180deg) scale(0.9);
        opacity: 0.9;
    }
    75% {
        transform: translateY(-30px) rotate(270deg) scale(1.05);
        opacity: 1;
    }
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.cta-button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.4s both;
}

.cta-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* About Section */
.about {
    padding: 80px 0;
    background: var(--bg-about);
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--color-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-avatar {
    display: flex;
    justify-content: center;
}

.about-avatar img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #3498db;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.skills h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-pro {
    background: #27ae60;
}

.skill-intermediate {
    background: #f39c12;
}

.skill-beginner {
    background: #e74c3c;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Experience and Achievements Container */
.experience-achievements-container {
    display: flex;
    gap: 30px;
    margin-top: 4rem;
}

/* Timeline Section */
.timeline-section {
    flex: 1;
    max-height: 380px; /* 设置与个人成就模块一致的高度 */
    overflow-y: auto;
    padding-right: 10px; /* 为滚动条留出空间 */
}

/* 自定义滚动条样式 */
.timeline-section::-webkit-scrollbar {
    width: 8px;
}

.timeline-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.timeline-section::-webkit-scrollbar-thumb {
    background: #3498db; /* 使用主题色 */
    border-radius: 10px;
}

.timeline-section::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.timeline-section h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3498db;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    width: 50%;
    padding: 0 2rem;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 15px;
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid #3498db;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-date {
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.timeline-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Achievements Section */
.achievements {
    flex: 1;
    text-align: center;
}

.achievements h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.achievement-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.achievement-item:hover {
    transform: translateY(-5px);
}

.achievement-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.achievement-content h4 {
    color: var(--text-primary);
    margin: 0;
}

/* Portfolio Section */
.portfolio {
    padding: 80px 0;
    background: var(--bg-portfolio);
}

.portfolio h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--color-primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-image {
    height: 200px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1);
}

.portfolio-info {
    padding: 20px;
}

.portfolio-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.portfolio-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #2980b9;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background: var(--bg-contact);
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--color-primary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-secondary);
}

.contact-form button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: #219a52;
}

/* Footer */
footer {
    background: var(--bg-footer);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #3498db;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header Styles */
    nav {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-right {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    /* Language Selector Responsive Styles */
    .language-selector {
        padding: 2px;
    }
    
    .language-selector button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-avatar {
        margin: 0 auto;
    }
    
    .experience-achievements-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .timeline-section, .achievements {
        margin-top: 0;
    }
    
    .timeline-section {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    
    .timeline::before {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: 21px;
        right: auto;
    }
    
    .achievements-list {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 120px 15px 80px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .about,
    .portfolio,
    .contact {
        padding: 60px 0;
    }
}
